<?php


/*
* Copyright (c) 2008-2016 vip.com, All Rights Reserved.
*
* Powered by com.vip.osp.osp-idlc-2.5.11.
*
*/

namespace com\vip\wms\gb\gateway\client\service;

class ImeiInfo {
	
	static $_TSPEC;
	public $vendorCode = null;
	public $itemCode = null;
	public $mpn = null;
	public $poNo = null;
	public $serialNo = null;
	public $imei1 = null;
	public $imei2 = null;
	public $mobileSerialNumber = null;
	
	public function __construct($vals=null){
		
		if (!isset(self::$_TSPEC)){
			
			self::$_TSPEC = array(
			1 => array(
			'var' => 'vendorCode'
			),
			2 => array(
			'var' => 'itemCode'
			),
			3 => array(
			'var' => 'mpn'
			),
			4 => array(
			'var' => 'poNo'
			),
			5 => array(
			'var' => 'serialNo'
			),
			6 => array(
			'var' => 'imei1'
			),
			7 => array(
			'var' => 'imei2'
			),
			8 => array(
			'var' => 'mobileSerialNumber'
			),
			
			);
			
		}
		
		if (is_array($vals)){
			
			
			if (isset($vals['vendorCode'])){
				
				$this->vendorCode = $vals['vendorCode'];
			}
			
			
			if (isset($vals['itemCode'])){
				
				$this->itemCode = $vals['itemCode'];
			}
			
			
			if (isset($vals['mpn'])){
				
				$this->mpn = $vals['mpn'];
			}
			
			
			if (isset($vals['poNo'])){
				
				$this->poNo = $vals['poNo'];
			}
			
			
			if (isset($vals['serialNo'])){
				
				$this->serialNo = $vals['serialNo'];
			}
			
			
			if (isset($vals['imei1'])){
				
				$this->imei1 = $vals['imei1'];
			}
			
			
			if (isset($vals['imei2'])){
				
				$this->imei2 = $vals['imei2'];
			}
			
			
			if (isset($vals['mobileSerialNumber'])){
				
				$this->mobileSerialNumber = $vals['mobileSerialNumber'];
			}
			
			
		}
		
	}
	
	
	public function getName(){
		
		return 'ImeiInfo';
	}
	
	public function read($input){
		
		$input->readStructBegin();
		while(true){
			
			$schemeField = $input->readFieldBegin();
			if ($schemeField == null) break;
			$needSkip = true;
			
			
			if ("vendorCode" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->vendorCode);
				
			}
			
			
			
			
			if ("itemCode" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->itemCode);
				
			}
			
			
			
			
			if ("mpn" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->mpn);
				
			}
			
			
			
			
			if ("poNo" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->poNo);
				
			}
			
			
			
			
			if ("serialNo" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->serialNo);
				
			}
			
			
			
			
			if ("imei1" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->imei1);
				
			}
			
			
			
			
			if ("imei2" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->imei2);
				
			}
			
			
			
			
			if ("mobileSerialNumber" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->mobileSerialNumber);
				
			}
			
			
			
			if($needSkip){
				
				\Osp\Protocol\ProtocolUtil::skip($input);
			}
			
			$input->readFieldEnd();
		}
		
		$input->readStructEnd();
		
		
		
	}
	
	public function write($output){
		
		$xfer = 0;
		$xfer += $output->writeStructBegin();
		
		if($this->vendorCode !== null) {
			
			$xfer += $output->writeFieldBegin('vendorCode');
			$xfer += $output->writeString($this->vendorCode);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->itemCode !== null) {
			
			$xfer += $output->writeFieldBegin('itemCode');
			$xfer += $output->writeString($this->itemCode);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->mpn !== null) {
			
			$xfer += $output->writeFieldBegin('mpn');
			$xfer += $output->writeString($this->mpn);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->poNo !== null) {
			
			$xfer += $output->writeFieldBegin('poNo');
			$xfer += $output->writeString($this->poNo);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->serialNo !== null) {
			
			$xfer += $output->writeFieldBegin('serialNo');
			$xfer += $output->writeString($this->serialNo);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->imei1 !== null) {
			
			$xfer += $output->writeFieldBegin('imei1');
			$xfer += $output->writeString($this->imei1);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->imei2 !== null) {
			
			$xfer += $output->writeFieldBegin('imei2');
			$xfer += $output->writeString($this->imei2);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->mobileSerialNumber !== null) {
			
			$xfer += $output->writeFieldBegin('mobileSerialNumber');
			$xfer += $output->writeString($this->mobileSerialNumber);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		$xfer += $output->writeFieldStop();
		$xfer += $output->writeStructEnd();
		return $xfer;
	}
	
}

?>